Moving Picture Experts Group (MPEG) video compression is currently used in many video products such as digital television set-top boxes, DSS, HDTV decoders, DVD players, video conferencing, Internet video, and other applications. These products benefit from MPEG video compression since compressed video requires less storage space for video information and less bandwidth for the transmission of the video information.
An MPEG video is a sequence of video frames comprised of intra coded I-frames and/or inter coded P and B-frames, as is well known in the art. Each video frame is typically divided into sub-sections of macro blocks (16×16 pixels in a data array). A macro block typically includes sub-sections of four luminance blocks and two chrominance blocks (8×8 data arrays). A luminance block specifies brightness information (e.g., luminance image coefficients) about the pixels in the block, while the two chrominance blocks specify Cr and Cb color information (e.g., Cr and Cb image coefficients) about the pixels in the macro block.
MPEG video encoding and decoding processes typically use discrete cosine transform (“DCT”) and inverse DCT (“iDCT”) to encode and decode coefficients of a block (i.e., data array). A DCT operation takes image values defined in a spatial domain and transforms them into a frequency domain. The DCT operation transforms the inputted image values into a linear combination of weighted basis functions. These basis functions are the frequency components of the inputted image values. As such, when a DCT operation is applied to a block of image values, it yields a block of weighted values corresponding to how much of each basis function is present in the original image to be encoded.
For most images, most of the image information lies at low frequencies which appear in the upper-left corner of the DCT-encoded block. The lower-right values of the DCT-encoded block represent higher frequencies, and are often small enough to be neglected with little visible distortion. The top left corner value in the DCT-encoded block is the DC (zero-frequency) component and lower and rightmore entries represent larger vertical and horizontal spatial frequencies.
The DCT operation is a separable transform in that the matrix that defines this transformation is decomposable into two matrices, one that corresponds to a column transform and another that corresponds to a row transform. Thus it can be implemented as two one-dimensional (1D) transforms. In other words, a two-dimensional (2D) DCT is just a 1D DCT applied twice, once in the column direction and once in the row direction. In the case of a 1D 8-point DCT, the first coefficient (the DC coefficient) represents the average value of the image values and the eighth coefficient represents the highest frequencies found in the image. An iDCT operation is used to convert the frequency coefficients back into the image information.
DCT encoding of a block is a two-dimensional (2D) transformation operation that can be expressed by the following formula:
            F      ⁡              (                  u          ,          υ                )              =                            C          u                2            ⁢                        C          υ                2            ⁢                        ∑                      y            =            0                    7                ⁢                                  ⁢                              ∑                          x              =              0                        7                    ⁢                                    f              ⁡                              (                                  x                  ,                  y                                )                                      ⁢                          cos              ⁢                                                          [                                                                    (                                                                  2                        ⁢                        x                                            +                      1                                        )                                    ⁢                  u                  ⁢                                                                          ⁢                  π                                16                            ]                        ⁢                          cos              ⁢                                                          [                                                                    (                                                                  2                        ⁢                        y                                            +                      1                                        )                                    ⁢                  υ                  ⁢                                                                          ⁢                  π                                16                            ]                                                    ⁢                            with:                ⁢                                  ⁢                  C          u                    =              {                                                                              1                                      2                                                                                                                                          if                      ⁢                                                                                          ⁢                      u                                        =                    0                                    ,                                                                                    1                                                                                  if                    ⁢                                                                                  ⁢                    u                                    >                  0                                                              ;                                    C              υ                        =                          {                                                                                          1                                              2                                                                                                                                                                          if                          ⁢                                                                                                          ⁢                          v                                                =                        0                                            ,                                                                                                            1                                                                                                      if                        ⁢                                                                                                  ⁢                        v                                            >                      0                                                                                                              In the formula above, a column dimension of the block is represented by x values and a row dimension of the block is represented by y values, so that f(x,y) is the image information at position [x,y] of the block. As such, F(u,v) is the 2D encoded image information at position [u,v] of the 2D encoded block.
A DCT decoder performs an inverse DCT transformation on a DCT encoded block to reconstruct the block. DCT decoding of a block is also a two-dimensional (2D) transformation operation, which can be expressed by the following formula:
      f    ⁡          (              x        ,        y            )        =            ∑              u        =        0            7        ⁢                  ⁢                  ∑                  υ          =          0                7            ⁢                        F          ⁡                      (                          u              ,              υ                        )                          ⁢                              C            u                    2                ⁢                              C            υ                    2                ⁢                  cos          ⁢                                          [                                                    (                                                      2                    ⁢                    x                                    +                  1                                )                            ⁢              u              ⁢                                                          ⁢              π                        16                    ]                ⁢                                  ⁢                  cos          ⁢                                          [                                                    (                                                      2                    ⁢                    y                                    +                  1                                )                            ⁢              υ              ⁢                                                          ⁢              π                        16                    ]                    In the formula above, the columns of the 2D encoded block are represented by u values and the rows of the 2D encoded block are represented by v values, so that F(u,v) is the encoded image data at position [u,v] of the block. As such, f(x,y) is the image data at position [x,y] of the block.
Conventionally, 2D DCT and 2D iDCT processes contain a pre-multiply stage that multiplies each coefficient of the block to be transformed by a pre-multiplication value. The pre-multiplication value is usually less than one. As such, the pre-multiplication operation results in the loss of precision, when it is used with fixed point arithmetic that rounds or truncates the multiplication results.